import { createStore , combineReducers} from 'redux'
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import userReducer from './user'

const persistConfig = {
  key: 'root',
  storage,
}
 

const reducer = combineReducers({
	user: userReducer
})

const persistedReducer = persistReducer(persistConfig, reducer)

const store = createStore(persistedReducer)
export const persistor = persistStore(store)

export default store